<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;

class ArticleRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * 添加信息不能为空
     *
     * @return array
     */
    public function rules()
    {
         return [
            'uid' => 'required',
            'title' => 'required',
            'author'=>'required',
            'pauthor'=>'required',
            'pic'=>'required|image',
            'cont'=>'required',
            'content'=>'required',
          
        ];
    }

    //错误信息提示
     public function messages()
    {
         return [
            'uid.required'=>'文章板块不能为空',
            'title.required'=>'文章标题不能为空',
            'author.required'=>'文章发布人不能为空',
             'pauthor.required'=>'文章原作者不能为空',
             'pic.required'=>'文章展示图不能为空',
             'cont.required'=>'文章简介不能为空',
             'content.required'=>'文章内容不能为空',
             
            

        ];
    }
}
